import tkinter as tk
from ..widgets.animated_button import create_icon_button
from ..styles.colors import BACKGROUNDS, TEXT_COLORS
from ..styles.fonts import get_font

def show_launch_screen(parent, items, on_enter_app):
    for widget in parent.winfo_children():
        widget.destroy()
    
    container = tk.Frame(parent, bg=BACKGROUNDS["main"])
    container.pack(fill="both", expand=True)
    
    title_label = tk.Label(
        container,
        text="🎮 游戏角色收藏馆",
        fg=TEXT_COLORS["accent"],
        bg=BACKGROUNDS["main"],
        font=get_font("title", "bold")
    )
    title_label.pack(pady=(80, 10))
    
    subtitle_label = tk.Label(
        container,
        text="管理你的英雄团队，最多4名成员",
        fg=TEXT_COLORS["secondary"],
        bg=BACKGROUNDS["main"],
        font=get_font("subheader")
    )
    subtitle_label.pack(pady=(0, 50))
    
    stats_frame = tk.Frame(container, bg=BACKGROUNDS["main"])
    stats_frame.pack(pady=20)
    
    total_chars = len(items)
    stats_text = f"当前角色: {total_chars}/4"
    
    stats_label = tk.Label(
        stats_frame,
        text=stats_text,
        fg=TEXT_COLORS["primary"],
        bg=BACKGROUNDS["main"],
        font=get_font("normal", "bold")
    )
    stats_label.pack()
    
    button_frame = tk.Frame(container, bg=BACKGROUNDS["main"])
    button_frame.pack(pady=30)
    
    enter_btn = create_icon_button(
        button_frame,
        "进入收藏馆",
        on_enter_app,
        "🚪",
        "accent"
    )
    enter_btn.pack(pady=10)
    
    return container